﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.ComponentModel;

namespace SixApp.Core
{
    public class EntityList<TEntity> : List<TEntity> where TEntity : Entity, new()
    {
        public bool HasItems { get { return this.Count > 0; }  }

        public int TotalRecords { get; set; }

        public object Data { get; set; }

        public virtual void Load(DataTable table)
        {
            foreach (DataRow row in table.Rows)
            {
                TEntity entity = new TEntity();
                entity.Load(row);
                this.Add(entity);
            }
        }

    }
}
